/**
 * Copyright (C) 2010 Cloudfarming <info@cloudfarming.nl>
 *
 * Licensed under the Eclipse Public License - v 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.cloudfarming.client.sensor.cropcircle;

import org.openide.util.NbPreferences;

/**
 * Cropcircle preferences, wraps the NbPreferences.forModule preference loader
 *
 * @author Timon Veenstra
 */
public enum CropcirclePreference {

    SENSOR_DATA_FILE_FORMAT("sensorDataFileFormat", "DDMMYYCC.CSV"),
    LOAD_DIR("loadDir", ""),
    ARCHIVE("archive", ""),
    LAST_DIR("lastDir", ""),
    DATABASE_DIR("dbDir", ""),
    LAST_SHAPE_DIR("lastShapeDir", ""),
    CROPCIRCLE_SENSOR_HEIGTH("cropCircleSensorHeight", "0"),
    NUMBER_OF_CROPCIRCLE_SENSORS("numberOfCropCircleSensors", "0"),
    CROPCIRCLE_SENSOR_SPREAD("cropCircleSensorSpread", ""),
    SENSOR_TYPE("sensorType", ""),
    SPECTRAL_CHANNELS("spectralRange", "");
    private String propertyName;
    private String defaultProperty;

    private CropcirclePreference(String propertyName, String defaultProperty) {
        this.propertyName = propertyName;
        this.defaultProperty = defaultProperty;
    }

    public String getDefaultProperty() {
        return defaultProperty;
    }

    public String getPropertyName() {
        return propertyName;
    }

    public String getValue() {
        return NbPreferences.forModule(this.getClass()).get(this.getPropertyName(), this.getDefaultProperty());
    }

    public void saveValue(String value) {
        NbPreferences.forModule(this.getClass()).put(this.getPropertyName(), value);
    }
}
